//
//@File    :	4.17_use_new.cpp
//@Time    :	2021/08/03 18:15:35
//@Auther  :	Sun Sheng
//@Contact :	970340843@qq.com
//@Desc    :	using the new operator
//

#include <iostream>

int main()
{
    using namespace std;
    int nights = 1001;
    int * pt = new int;
    *pt = 1001;

    cout<<"nights value = ";
    cout<<nights<<":location"<<&nights<<endl;
    cout<<"int ";
    cout<<"value = "<<*pt<<":location = "<<pt<<endl;
    double*pd = new double;
    *pd = 10000001.0;

    cout<<"double ";
    cout<<"value = "<<*pd<<":location = "<<pd<<endl;
    cout<<"location of pointer pd: "<<&pd<<endl;
    cout<<"size of pt = "<<sizeof(pt);
    cout<<":size of *pt = "<<sizeof(*pt)<<endl;
    cout<<"size od pd = "<<sizeof pd;
    cout<<":size od *pd = "<<sizeof(*pd)<<endl;
    system("pause");
    return 0;
}